package com.example.lvsuo.controller;


import com.example.lvsuo.entity.Jc;
import com.example.lvsuo.entity.vo.JcVo;
import com.example.lvsuo.modal.Result;
import com.example.lvsuo.service.IJcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 案件信息 前端控制器
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@RestController
@RequestMapping("/jc")
public class JcController {

    @Autowired
    IJcService js;

    @GetMapping
    Result queryJc(JcVo j){
        return Result.back(js.queryJc(j));
    }

    @PostMapping
    Result addJc(@Valid Jc j){
        js.save(j);
        return Result.back("成功");
    }
}

